package com.qingyouchuxing.mall.biz.domain.bo;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.RelationOneToMany;
import com.qingyouchuxing.mall.biz.domain.entity.MallGoodsSku;
import com.qingyouchuxing.mall.biz.domain.entity.MallGoodsSpu;
import com.ruoyi.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class MallGoodsSpuBO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
//    @Column(value = )
    private Long spuId;

    /**
     * 所属商品id
     */
    @NotNull(groups = EditGroup.class,message = "所属商品不能为空")
    private Long fkGoodsId;

    /**
     * spu名称
     */
    @NotBlank(message = "spu名称不能为空")
    private String spuName;

    /**
     * 相关sku
     */
    @NotBlank(message = "sku不能为空")
    private List<MallGoodsSkuBO> skuList;


    /** 乐观锁 */
    @NotNull
    @Min(0)
    private Integer version;
}
